package lzsrkpt.api.demo;
import java.util.HashMap;
import java.util.Map;

public class ResponseCode {
    /**
     * 响应成功代码
     */
    public static final String RESPONSE_SUCCESS_CODE = "0000";

    /**
     * 响应失败代码
     */
    public static final String RESPONSE_ERROR_CODE = "0001";

    /**
     * TOKEN失效
     */
    public static final String RESPONSE_TOKEN_ERROR_CODE = "0002";

    /**
     * 接口异常
     */
    public static final String RESPONSE_EXCEPTION_CODE = "0003";

    /**
     * 系统全局错误
     */
    public static final String SYS_EXCEPTION_CODE = "0004";

    /**
     * 接口异常，数据格式错误
     */
    public static final String RESPONSE_ERROR_DATA_FORMAT = "0101";

    /**
     * 字段不能为空
     */
    public static final String RESPONSE_ERROR_FIELD_EMPTY = "0201";

    /**
     * 字段过长
     */
    public static final String RESPONSE_ERROR_FIELD_LONG = "0202";

    /**
     * 字段非数字
     */
    public static final String RESPONSE_ERROR_FIELD_NOTNUM = "0203";

    /**
     * 字段不能含有中文
     */
    public static final String RESPONSE_ERROR_FIELD_NOTCN = "0204";

    /**
     * 日期格式不正确
     */
    public static final String RESPONSE_ERROR_DATE_FORMAT = "0205";

    /**
     * 找不到字典
     */
    public static final String RESPONSE_ERROR_NO_DIC = "0206";
    /**
     * 其他
     */
    public static final String RESPONSE_ERROR_OTHER = "0207";


    public static final Map<String, String> RESP_INFO = new HashMap<String, String>();

    static {
        RESP_INFO.put(RESPONSE_SUCCESS_CODE, "响应成功代码");
        RESP_INFO.put(RESPONSE_ERROR_CODE, "响应失败代码");
        RESP_INFO.put(RESPONSE_TOKEN_ERROR_CODE, "TOKEN失效");
        RESP_INFO.put(RESPONSE_EXCEPTION_CODE, "接口异常");
        RESP_INFO.put(SYS_EXCEPTION_CODE, "系统全局错误");
        RESP_INFO.put(RESPONSE_ERROR_DATA_FORMAT, "接口异常，数据格式错误");
        RESP_INFO.put(RESPONSE_ERROR_FIELD_EMPTY, "字段不能为空");
        RESP_INFO.put(RESPONSE_ERROR_FIELD_LONG, "字段过长");
        RESP_INFO.put(RESPONSE_ERROR_FIELD_NOTNUM, "字段非数字");
        RESP_INFO.put(RESPONSE_ERROR_FIELD_NOTCN, "字段不能含有中文");
        RESP_INFO.put(RESPONSE_ERROR_DATE_FORMAT, "日期格式不正确");
        RESP_INFO.put(RESPONSE_ERROR_NO_DIC, "找不到字典");
        RESP_INFO.put(RESPONSE_ERROR_OTHER, "其他");
    }
}
